package com.example.demo.mapper;

import com.example.demo.mapper.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * @author Lucy
 * @create 2024-01-28 20:45
 */
@Mapper
@Repository
public interface StudentLoginMapper {
    @Select("SELECT * FROM student WHERE number = #{number}")
    Student selectStudentByNumber(String number);
    @Select("SELECT * FROM student WHERE phone = #{phone}")
    Student selectStudentByPhone(String phone);
    @Select("SELECT * FROM student WHERE identity_card = #{identityCard}")
    Student selectStudentByIDCard(String identityCard);
    @Update("UPDATE student "+
            "SET password = #{password}, nickname = #{nickname} "+
            "WHERE identity_card = #{identityCard} ")
    int updateStudentPassword1(Student registerStudent);

}
